package com.big.identify.controller;

import com.big.common.result.Result;
import com.big.identify.service.RecognizeService;
import com.big.model.model.recognize.RootProducts;
import com.tencentcloudapi.common.exception.TencentCloudSDKException;
import io.swagger.annotations.ApiModelProperty;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/api/tx/recognize")
public class RecognizeController {

    @Autowired
    RecognizeService recognizeService;

    @ApiModelProperty("腾讯云以图识图")
    @GetMapping("/recognizePictures")
    public Result RecognizePictures(@RequestParam("url") String url ) throws TencentCloudSDKException {
        RootProducts s = recognizeService.RecognizePictures(url);
        return Result.ok(s);
    }

}
